<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <!-- <script>
            const arr = [2, 6, 12, 99, 43, 56, 1];
            let max = arr[0];
            for (let i = 0; i < arr.length; i++) {
                if (arr[i] > max) {
                    max = arr[i];
                }
                console.log("最大值为" + max);
            }
        </script> -->
        <!-- <script>
            const arr = [1, 2];
            let sum = arr[0];
            arr[0] = arr[1];
            arr[1] = sum;
            console.log(arr[0]);
            console.log(arr[1]);
        </script> -->
        <script>
            const arr1 = ["a", "b", "a", "c", "c", "d", "b"];
            let newArr = [];
            for (let i = 0; i < arr1.length; i++) {
                if (newArr.indexOf(arr1[i]) === -1) {
                    newArr.push(arr1[i]);
                }
            }
            console.log(newArr);
        </script>
    </body>
</html>
